/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Tag;

import java.util.logging.Level;
import java.util.logging.Logger;
import org.JSONException;
import org.JSONObject;

/**
 *
 * @author tambeotb4
 */
public class Tag {
    private JSONObject json;
    private boolean sendFile;
    public Tag(String mess_ln){
        try {
            json = new JSONObject(mess_ln);
            sendFile=false;
        } catch (JSONException ex) {
           // Logger.getLogger(Tag.class.getName()).log(Level.SEVERE, null, ex);
            sendFile=true;
        }
    }
    public boolean isSendFile(){
        return sendFile;
    }
    public String getTag() throws JSONException{
        if(sendFile==false)
            return json.names().getString(0);
        else
            return "This is SendFile message";
    }
    public String getContent() throws JSONException{
        if(sendFile==false)
            return json.getString(json.names().getString(0));
        else
            return "This is SendFile message";

    }

}
